package com.yuanfengPlus.basicInfoManage.logisticscompany.controller;


import com.yuanfengPlus.basicInfoManage.logisticscompany.model.LogisticsCompanyInfo;
import com.yuanfengPlus.basicInfoManage.logisticscompany.service.impl.LogisticsCompanyServiceImpl;
import com.yuanfengPlus.utils.PageResult;
import com.yuanfengPlus.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/logisticscompany")
@Api(tags = "物流公司信息管理")

public class LogisticsCompanyController {
    @Resource
    private LogisticsCompanyServiceImpl lcsi;
    @PostMapping("/insert")
    @ApiOperation("添加物流公司信息")
    public Result<String> insert(@RequestBody LogisticsCompanyInfo logisticsCompanyInfo) {
        return lcsi.insert(logisticsCompanyInfo);
    }
    @PostMapping("/update")
    @ApiOperation("修改物流公司信息")
    public Result<String> update(@RequestBody LogisticsCompanyInfo logisticsCompanyInfo) {
        return lcsi.update(logisticsCompanyInfo);
    }
    @PostMapping("/selectAll")
    @ApiOperation("查询物流公司信息")
    public Result<PageResult> selectAll(@RequestBody Map<String, Object> params) {
        return Result.success(lcsi.selectAll(params));
    }
}
